import {observable, action} from 'mobx-miniprogram'

export const store = observable({
    numA: 1,
    numB: 2,
    activetabbar: 'home',

    get sum() {
        return this.numA + this.numB
    },

    updateNumA: action(function (pyload) {
        this.numA = pyload
    }),

    updateNumB: action(function (pyload) {
        console.log(pyload, 'pyload')
        this.numB = pyload
    }),

    updateActiveTabbar: action(function (pyload) {
        this.activetabbar = pyload
    })
})
